package com.example.spider;

import com.example.util.UrlFileDownloadUtil;
import us.codecraft.webmagic.ResultItems;
import us.codecraft.webmagic.Task;
import us.codecraft.webmagic.pipeline.Pipeline;

public class ComicInfoPipeline implements Pipeline {
    @Override
    public void process(ResultItems resultItems, Task task) {
        // System.out.println(resultItems.getRequest().getUrl());
        String url = resultItems.get("img").toString();
        String partName = resultItems.get("partName").toString();
        UrlFileDownloadUtil.downloadPicture(url, partName);
    }
}
